home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / amiga / asrc29k.lha / session.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  2.0 KB  |  73 lines

  1. #ifndef    NULLSESSION
  2. #include <stdio.h>
  3. #include "global.h"
  4. #include "ftpcli.h"
  5. #include "telnet.h"
  6. #include "icmp.h"
  7. #include "ax25.h"
  8. #include "proc.h"
  9. #include "tty.h"
  10.  
  11. #define    MOREROWS    24    /* rows on screen before --more-- */
  12.  
  13. /* Session control structure; only one entry is used at a time */
  14. struct session {
  15.     int type;
  16. #define    FREE        0
  17. #define    TELNET        1
  18. #define    FTP        2
  19. #define    AX25TNC        3
  20. #define    FINGER        4
  21. #define    PING        5
  22. #define NRSESSION    6
  23. #define    COMMAND        7
  24. #define    MORE        8
  25. #define    HOP        9
  26. #define POST        10
  27. #define    RLOGIN        11
  28. #define PPPPASS        12
  29.     char *name;    /* Name of remote host */
  30.     union {
  31.         struct ftpcli *ftp;
  32.         struct telnet *telnet;
  33.     } cb;
  34.     struct proc *proc;    /* Primary session process (e.g., tn recv) */
  35.     struct proc *proc1;    /* Secondary session process (e.g., tn xmit) */
  36.     struct proc *proc2;    /* Tertiary session process (e.g., upload) */
  37.     int s;            /* Primary network socket (control for FTP) */
  38.     FILE *record;        /* Receive record file */
  39.     char *rfile;        /* Record file name */
  40.     FILE *upload;        /* Send file */
  41.     char *ufile;        /* Upload file name */
  42.     struct ttystate ttystate;
  43.     struct screen *screen;
  44.     int input;        /* Input socket */
  45.     int output;        /* Output socket */
  46.     int flowmode;        /* control "more" mode */
  47.     int row;        /* Rows remaining until "more" */
  48.     int morewait;        /* Output driver is waiting on us */
  49. };
  50. #define    NULLSESSION    (struct session *)0
  51.  
  52. extern char *Sestypes[];
  53. extern unsigned Nsessions;        /* Maximum number of sessions */
  54. extern struct session *Sessions;    /* Session descriptors themselves */
  55. extern struct session *Current;        /* Always points to current session */
  56. extern struct session *Lastcurr;    /* Last non-command session */
  57. extern struct session *Command;        /* Pointer to command session */
  58.  
  59. /* In session.c: */
  60. void freesession __ARGS((struct session *sp));
  61. struct session *sessptr __ARGS((char *cp));
  62. struct session *newsession __ARGS((char *name,int type));
  63. void upload __ARGS((int unused,void *sp1,void *p));
  64.  
  65. /* In pc.c: */
  66. void swapscreen __ARGS((struct session *old,struct session *new));
  67.  
  68. extern int16 Lport;
  69. #define    ALERT_EOF    1
  70.  
  71.  
  72. #endif    /* NULLSESSION */
  73.